<?php use_stylesheet('order.css') ?>
<?php
slot('title', sprintf('Order name: %s', $order->getOrdername()))
?>
<table id="order_details">
  <tbody>
    <tr>
      <th>Order identifier</th>
      <td><?php echo $order->getIdorder() ?></td>
    </tr>
    <tr>
      <th>Order name</th>
      <td><?php echo $order->getOrdername() ?></td>
    </tr>
    <tr>
      <th>Text category</th>
      <td><?php echo $order->getTextcategories(); ?></td>
    </tr>
    <tr>
      <th>Website</th>
      <td>
        <?php
        if ($order->getIsWebsite()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
      
    </tr>
    <tr>
      <th>Print</th>
      <td>
        <?php
        if ($order->getIsPrint()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>

    </tr>
    <tr>
      <th>Newsletter</th>
      <td>
        <?php
        if ($order->getIsNewsletter()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Poster</th>
      <td>
        <?php
        if ($order->getIsPoster()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Blog</th>
      <td>
        <?php
        if ($order->getIsBlog()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Other text media</th>
      <td><?php echo $order->getOthertextmedium() ?></td>
    </tr>
    <tr>
      <th>Target group</th>
      <td><?php echo $order->getTargetgroup() ?></td>
    </tr>
    <tr>
      <th>Existing customer</th>
      <td>
        <?php
        if ($order->getIsExistingCustormer()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>New customer</th>
      <td>
        <?php
        if ($order->getIsNewCustomer()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Women</th>
      <td>
        <?php
        if ($order->getIsWomen()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Men</th>
      <td>
        <?php
        if ($order->getIsMen()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Style</th>
      <td><?php echo $order->getFormalstyle() ?></td>
    </tr>
    <tr>
      <th>Person style</th>
      <td><?php echo $order->getPersonstyle() ?></td>
    </tr>
    <tr>
      <th>Emotion style</th>
      <td><?php echo $order->getEmotionstyle() ?></td>
    </tr>
    <tr>
      <th>Formulate</th>
      <td><?php echo $order->getFormulatetext() ?></td>
    </tr>
    <tr>
      <th>Free Text</th>
      <td><?php echo $order->getFreetext() ?></td>
    </tr>
    <tr>
      <th>Image</th>
      <td>
        <img src="/uploads/orders/<?php echo $order->getUrlimagestructure() ?>" alt="<?php echo $order->getOrdername() ?> Image" />        
        <?php //echo $order->getUrlimagestructure()  ?>
      </td>
    </tr>
    <tr>
      <th>Standard</th>
      <td>
        <?php
        if ($order->getIsStandard()) {
          echo "&#x2713;";
        } else {
          echo "x";
        }
        ?></td>
    </tr>
    <tr>
      <th>Edition options</th>
      <td colspan="5">
        <?php 
        $tech = "False";
        $foraign = "False";
        $superlative = "False";
        $oldLang = "False";
        $startSent = "False";
        $ownC = "False";

        if (!is_null($order->getEditionoptions())){

            if ($order->getEditionoptions()->getIsTechnicalTerms()) {
              $tech = "true";
            }
            if ($order->getEditionoptions()->getIsForaignWord()) {
              $foraign = "true";
            }
            if ($order->getEditionoptions()->getIsSuperlative()) {
              $superlative = "true";
            }
            if ($order->getEditionoptions()->getIsOldLanguage()) {
              $oldLang = "true";
            }
            if ($order->getEditionoptions()->getIsStartOfSentence()) {
              $startSent = "true";
            }
            $ownC = "";
            if ($order->getEditionoptions()->getOwnchoice()->getText() != null)
            {
              $ownC = $order->getEditionoptions()->getOwnchoice()->getText();
            }
        
        }
        echo sprintf("Technical terms: %s | Foraign words: %s | 
          Superlative: %s | Old language: %s | Start of sentence: %s | Own Choice: %s ",
                $tech,$foraign,$superlative,$oldLang, $startSent, $ownC);
        
        ?>
      </td>

    </tr>
    <tr>
      <th>Created at</th>
      <td><?php echo $order->getCreatedAt() ?></td>
    </tr>
    <tr>
      <th>Expires at</th>
      <td><?php echo $order->getExpiresAt() ?></td>
    </tr>
    <tr>
      <th>Updated at</th>
      <td><?php echo $order->getUpdatedAt() ?></td>
    </tr>
  </tbody>
</table>

<hr />

<a href="<?php echo url_for('order/edit?idOrder='.$order->getIdorder()) ?>">Edit</a>
&nbsp;
<a href="<?php echo url_for('order/index') ?>">List</a>
